-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: Use a faster comparison when enumeration filter strings don't have wildcards #324
Conversation
@@ -107,15 +109,31 @@ public string GetFilterString() | |||
return this.filterString; | |||
} | |||
|
|||
private static bool NameMatchsNoWildcardFilter(string name, string filter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: Matches
|
||
// Use our own enumerator to avoid having to dispose anything | ||
private ProjectedFileInfoEnumerator fileInfoEnumerator; | ||
private FileNamePatternMatcher patternMatcher; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename these to better names:
patternMatcher -> doesPatternMatch
wildcardPatternMatcher -> doesWildcardPatternMatch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great and that's a really nice perf win!
Update
ActiveEnumeration
to usestring.Equals
rather thanUtils.IsFileNameMatch
when the enumeration filter string does not have wildcards.Times with scenario provided by @kyle-rader